// import { CanActivate, ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common'
// import { Observable } from 'rxjs'

import { AuthGuard } from '@nestjs/passport'
import { Injectable } from '@nestjs/common'

@Injectable()
export class JwtGuard extends AuthGuard('jwt') {
  constructor() {
    super()
  }
  // canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
  //   const request = context.switchToHttp().getRequest()
  //   const token = this.extractTokenFromHeader(request)
  //   if (!token) {
  //     throw new UnauthorizedException({ message: 'authentication failed' })
  //   }
  //   return true
  // }
  // private extractTokenFromHeader(request: Request): string | undefined {
  //   const [type, token] = (request.headers as any)?.authorization?.split(' ') || []
  //   return type === 'Bearer' ? token : undefined
  // }
}
